package com.qijian.maindata.domain.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * 项目首页
 *
 * @author qijian
 * @date 2021-10-09
 */

@Data
@ToString
public class ProjectHomeVo {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;
    private String nickName;
    private String phoneNumber;
    private String deptName;
    private String postName;
    private String avatar;
    @JSONField
    private String workType;
    @ApiModelProperty(value = "待处理-计划")
    private Integer waitPlan;
    @ApiModelProperty(value = "待处理-NCR")
    private Integer waitNcr;
    @ApiModelProperty(value = "待处理-8D")
    private Integer waitBd;
    @ApiModelProperty(value = "异常-生产")
    private Integer proException;
    @ApiModelProperty(value = "异常-采购")
    private Integer purmException;
    @ApiModelProperty(value = "异常-成本")
    private Integer costException;
    @ApiModelProperty(value = "异常-质检")
    private Integer testException;
    @ApiModelProperty(value = "异常-总计")
    private Integer countException;
    @ApiModelProperty(value = "待处理-总计")
    private Integer countWait;
    @ApiModelProperty(value = "绩效得分")
    private BigDecimal scope;
    @ApiModelProperty(value = "排名")
    private Integer ranking;
    @ApiModelProperty(value = "在制")
    private Integer inCount;

    public Integer getCountException() {
        return proException + purmException + costException + testException;
    }

    public Integer getCountWait() {
        return waitPlan + waitNcr + waitBd;
    }
}
